﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GL_CommonPrint.DataModels
{
    static public class GeneralMethods
    {
        // A转换为1 B转换为2 AA转换为27 AB转换为28 以此类推
        static public int TextToNumber(string text)
        {
            text = text.ToUpper();
            return text
                .Select(c => c - 'A' + 1)
                .Aggregate((sum, next) => sum * 26 + next);
        }
    }
}
